-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fake pagination for sled_list_uninitialized #4720
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is very close; thanks for doing it
_query_params: Query<PaginatedById>, | ||
) -> Result<HttpResponseOk<ResultsPage<UninitializedSled>>, HttpError> { | ||
let apictx = rqctx.context(); | ||
let handler = async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't think we want to offer a
sort_by
query parameter that we ignore - I'm fine ignoring the
limit
parameter, but perhaps we could use it below - I think we want to produce an error if a caller specifies a page token
_query_params: Query<PaginatedById>, | |
) -> Result<HttpResponseOk<ResultsPage<UninitializedSled>>, HttpError> { | |
let apictx = rqctx.context(); | |
let handler = async { | |
query: Query<PaginationParams<EmptyScanParams, ()>>, | |
) -> Result<HttpResponseOk<ResultsPage<UninitializedSled>>, HttpError> { | |
let pag_params = query.into_inner(); | |
if let dropshot::WhichPage::Next(last_seen) = &pag_params.page { | |
return Err(Error::invalid_value(last_seen.clone(), "bad page token").into()); | |
}; | |
let apictx = rqctx.context(); | |
let handler = async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip! Fixed in 06a3851.
openapi/nexus.json
Outdated
}, | ||
{ | ||
"in": "query", | ||
"name": "sort_by", | ||
"schema": { | ||
"$ref": "#/components/schemas/IdSortMode" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally this should not be here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 06a3851.
"x-dropshot-pagination": { | ||
"required": [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lfgtm
No description provided.